package Class.Advance.Polymorphism.Basis;

public class Test {
    public static void main(String[] args) {
        //多态的表现形势<farther_class> <var_name> = new <kid_class>(value1, value2+...);
        //条件：1.有继承关系；
        //      2.有父类引用指向子类；
        //      3.有方法重写
        Person person1 = new Person("Nick", 18);
        Person person2 = new Student("Jack", 18);
        Person person3 = new Teacher("Black", 25);
        person1.show();
        person2.show();
        person3.show();
    }
}
